package com.java.entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * 用户角色
 * @author Administrator
 *
 */
@Entity
@org.hibernate.annotations.Entity(
		selectBeforeUpdate = true, 
		dynamicInsert = true, 
		dynamicUpdate = true
)
@Table(name="role")
public class Role implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1025271570979027053L;

	@Id
	@GeneratedValue
	private Long id;
	
	/**
	 * 角色名称
	 */
	@Column(length=20)
	private String roleName;

	/**
	 * 描述
	 */
	@Column(length=200)
	private String detail;
	
	/**
	 * 用户列表
	 */
//	@OneToMany(mappedBy="role",cascade=CascadeType.PERSIST)
//	private List<User> users = new ArrayList<User>();
			
	/**
	 * 操作权限
	 */
	@Column(length=1000)
	private String opAcl;
	
//	public List<User> getUsers() {
//		return users;
//	}
//
//	public void setUsers(List<User> users) {
//		this.users = users;
//	}

	public String getOpAcl() {
		return opAcl;
	}

	public void setOpAcl(String opAcl) {
		this.opAcl = opAcl;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getRoleName() {
		return roleName;
	}

	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}

	public String getDetail() {
		return detail;
	}

	public void setDetail(String detail) {
		this.detail = detail;
	}

}
